package org.deltaset.meta.internal.mockmeta;

import java.util.List;
import org.deltaset.meta.annotation.DsAcceptEntity;
import org.deltaset.meta.annotation.DsDefaultFinder;
import org.deltaset.meta.annotation.DsFactoryMethod;
import org.deltaset.meta.annotation.DsFirstResult;
import org.deltaset.meta.annotation.DsMaxResult;
import org.deltaset.meta.annotation.DsOrder;
import org.deltaset.meta.annotation.DsReturnEntity;

/**
 *
 * @author dmakariev
 */
public interface ModelRepository {

    @DsReturnEntity
    Object findById(Object id);

    @DsReturnEntity
    @DsFactoryMethod
    Object newEntity();

    @DsDefaultFinder
    List findAll(@DsFirstResult Integer firstResult, @DsMaxResult Integer maxResult);

    Long countAll();

    @DsAcceptEntity
    @DsOrder("1.1")
    void save(Object entity);

    @DsAcceptEntity
    @DsReturnEntity
    @DsOrder("1.2")
    Object edit(Object entity);

    boolean disableEdit(Object entity);

    @DsAcceptEntity
    @DsOrder("1.3")
    void warnDelete(Object entity);

    boolean disableWarnDelete(Object entity);
}
